﻿//JumbotCms_4.1 Final
using System;
using System.Data;
using System.Web;
using JumbotCms.API;
namespace JumbotCms.WebFile.User
{
    public partial class _changeavatarCustomerHandler : JumbotCms.API.UserCenter
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            User_Load("", "html");
            if (this.Page.Request.Files.Count > 0)
            {
                for (int j = 0; j < this.Page.Request.Files.Count; j++)
                {
                    HttpPostedFile oFile = this.Page.Request.Files[j];
                    if (oFile != null && oFile.ContentLength > 0)
                    {
                        string fileContentType = oFile.ContentType; //文件类型
                        string fileExtension = System.IO.Path.GetExtension(oFile.FileName).ToLower(); //上传文件的扩展名
                        string FullPath = q("filename") + fileExtension;
                        oFile.SaveAs(Server.MapPath(FullPath));
                        Session["jcms_user_avatar"] = FullPath;
                        Response.Write("<script>parent.alert('ok');</script>");
                    }
                }
            }
        }
    }
}
